import pandas as pd
import os
os.system('cls')
# series_apples = pd.Series([1, 3, 7, 4])
# series_bananas = pd.Series([2, 6, 3, 5])
# print(series_apples)
# print(series_bananas)
# print('*'*50)

# df = pd.DataFrame({ 'Apples': series_apples, 'Bananas': series_bananas })
# print(df)
# print('*'*50)

# df = pd.DataFrame([series_apples, series_bananas])
# print(df)
# print('*'*50)

# series_apples.name = 'Apple'
# series_bananas.name = 'Bananas'
# print(series_apples)
# print(series_bananas)
# print('*'*50)
# df = pd.DataFrame([series_apples, series_bananas])
# print(df)
# print('*'*50)

# df = pd.DataFrame({ 'Apples': series_apples, 'Bananas': series_bananas })
# print(df)
# print('*'*50)

# 创建一个Series对象，指定名称为'A'，值分别为1, 2, 3, 4
# 默认索引为0, 1, 2, 3
series = pd.Series([1, 2, 3, 4], name='A')

# 显示Series对象
print(series)

# 如果你想要显式地设置索引，可以这样做：
custom_index = [11, 2, 3, 4]  # 自定义索引
series_with_index = pd.Series([1, 2, 3, 4], index=custom_index, name='A')

# 显示带有自定义索引的Series对象
print(series_with_index)
print(series_with_index[11])
print(series[0])
